<?php
$domains = file_get_contents('./1127_new.txt');
$reg = "/\S+bahaojie.com.cn/is" ;
preg_match_all($reg,$domains,$matches);
print_r($matches);
die;
foreach($domains as $d){
  //asp_365hjdcom	1615919321	正在运行	www.365hjd.com.sdshuhua.com.cn	* 全部未分配 *	80		
  $reg = '/(www\.\w+\.\w+)\.sdshuhua.com.cn/is' ;
  preg_match($reg,$d,$match);
  if(empty($match)){
    continue;
  }
  $www_d = $match[1];
  $_d = substr($match[1],4);
  $str = <<<EOF
  <VirtualHost *:80>
    ServerName {$www_d}
    ServerAlias {$_d}
    ProxyRequests Off
    <Proxy *>
      Order deny,allow
      Allow from all
    </Proxy>
    ProxyPass / http://{$www_d}.sdshuhua.com.cn/
    ProxyPassReverse / http://{$www_d}.sdshuhua.com.cn/
  </VirtualHost>
EOF;

  echo $str ;
  echo "\n" ;

}
